﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.CMS263.BLL;
using Com.CMS263.PO;
using Com.CMS263.Util;
using System.Text;

namespace Com.CMS263.Web.manage
{
    public partial class Manage_User : System.Web.UI.Page
    {
        public IList<Guest> guestlist = new List<Guest>();
        GuestBLL guestbll = new GuestBLL();
        public IList<Guest> Searchlist = new List<Guest>();
        public int ListCount = 0;
        public int pageindex = 0;
        public int pagesize = 15;
        public IList<Guest> SearchAlllist = new List<Guest>();
        public string key = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                pageindex=Convert .ToInt32(Request .QueryString["page"]);
                if (pageindex == 0)
                { pageindex = 1; }
                ListCount =guestbll.GetAllUser().Count;
                ViewState["key"] = Request["key"];
                key = Request["key"];
                if (key != null && key != "")
                {
                    ListCount = guestbll.GetCount(key);
                }
                 guestlist = guestbll.GetGuestList(key, pagesize, pageindex); 
            }
            catch { }
        }
        public string GetPager()
        {
            return EnPager.GetPager(ListCount, pagesize, pageindex, "&key=" + ViewState["key"]);
        }
    }
}
